import requests
import json

#url_get_token = "http://127.0.0.1:8889/api_v1/user/login"
url_get_token = "http://47.96.235.182:8885/api_v1/user/login"
#http://47.96.235.182:8885/
password = "ARN02psONIQ1voqZZgM4cEWDwmyZlkbj1SXATU0VKPLgNLYVtZAzLEE/A7ju0x/zE7r5ceLXYYwL0C6TwWG/jZoIRCMLACzfsg8Q4sUkFB1aa6TUZHibxcergzVAZkwL+MfwAAXrdlf6ImyhIk3i3J26/K/Z5ojw7CHGZ0xRF/sz4hKzJ51hnba3iyaLZJd3TSvbP1Aa9yxM91UcWkFBUJq5HhLrdjGqU0e74D1wwlU35qgs10eyXXmFizXtgpbB4yFnvViD19GDVdM6FFckmy5rfCN9IsEkYcjjvRMBHXb4AR7Y/YvjHAsPCUSg1NhOXetnpBy2DM1LR64NLVhLHw=="
name_pwd = {
  "username": "user-1",
  "password": password
}
r1 = requests.post(url=url_get_token,data=json.dumps(name_pwd))
get_token = r1.text
get_token = json.loads(get_token)
token = get_token["access_token"]
print(token)

url_open = 'http://47.96.235.182:8885/project/open_project/get_all_inf'
url_open = 'http://127.0.0.1:8889/project/open_project/get_all_inf'

payload = {"user_id":"1"}
data1 = {
  "id": {
    "user_id": "1"
  },
  "token": {
    "token_data": token
  }
}
headers = {'accept': 'application/json',
           'content-type': 'application/json',
           'Authorization':'Bearer ' + token}
r = requests.post(url=url_open, data=json.dumps(data1))